import exportDialogComponent from './exportDialog.vue'
let $vm
export default {
  install (Vue) {
    let ExportDialog = Vue.extend(exportDialogComponent)
    if (!$vm) {
      $vm = new ExportDialog({el: document.createElement('div')})
      document.body.appendChild($vm.$el)
    }
    const exportdialog = {
      open (item) {
        $vm.open(item)
      },
      close () {
        $vm.close()
      }
    }
    Vue.$exportDialog = exportdialog
    Vue.mixin({
      created: function () {
        this.$exportDialog = Vue.$exportDialog
      }
    })
  }
}
